cmake_minimum_required(VERSION 3.3.1)

PROJECT( "librtlsdr" C )

ADD_SUBDIRECTORY(libusb)

FILE ( GLOB_RECURSE SOURCES_LIB "src/*.c" )

SET ( CMAKE_C_FLAGS         "-Wall" )
SET ( CMAKE_C_FLAGS_DEBUG   "-g -DDEBUG")
SET ( CMAKE_C_FLAGS_RELEASE "-O3 -DNDEBUG" )

FIND_LIBRARY( LOG_LIB log )

ADD_LIBRARY( ${PROJECT_NAME} SHARED ${SOURCES_LIB} )
TARGET_INCLUDE_DIRECTORIES( ${PROJECT_NAME} PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include" )
TARGET_LINK_LIBRARIES( ${PROJECT_NAME} ${LOG_LIB} libusb )